package lab02.text03;

/**
 * Created by Adminitrator on 2017/10/12.
 */
public class Student {
    //属性：三项成绩 计算机成绩、数学成绩、英语成绩
    float computerGrade;
    float mathGrade;
    float englishGrade;
    //行为
    //返回总分
    float sum(){
        return computerGrade+mathGrade+englishGrade;
    }
    //返回平均值
    float aver(){
        return (computerGrade+mathGrade+englishGrade)/3;
    }
    //最高分
    float max(){
        float a;
        if(computerGrade>mathGrade)
        a=computerGrade;
        else a=mathGrade;
        if (englishGrade>a)
            a=englishGrade;
        return a;
    }
    //最低分
    float min(){
        float b;
        if(computerGrade<mathGrade)
            b=computerGrade;
        else b=mathGrade;
        if (englishGrade<b)
            b=englishGrade;
        return b;
    }
    //完整信息
    void printStudent(){
        System.out.println("计算机成绩："+computerGrade);
        System.out.println("数学成绩："+mathGrade);
        System.out.println("英语成绩："+englishGrade);
    }
    public static void main(String[] args) {

    }
}
